<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.global.js"></script>
    <script src="../lodash.min.js"></script>
</head>

<body>
    <div id="app">
        <button @click="onClick">00544</button>
    </div>

    <script>
        const app = {
            methods: {
                onClick: function () {
                    console.log("令妹");
                },

                // 用 Lodash 的防抖函数
                //  onClick: _.debounce(function () {
                //     console.log("令妹");
                // }, 1000),

                // 用 Lodash 的节流函数
                onClick: _.throttle(function () {
                    console.log("令妹");
                }, 1000)
            }
        }
        const vm = Vue.createApp(app).mount("#app")
    </script>
</body>

</html>